import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";
import Login from "../views/Login.vue";
<<<<<<< HEAD
import AlbumView from "../views/AlbumView.vue";
import AlbumDetailView from "../views/AlbumDetailView.vue";
=======
>>>>>>> 808097149b9b03668259b819c5529eb708b7a331

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/login"  // 将根路径重定向到登录页
    },
    {
      path: "/home",
      name: "home",
      component: HomeView,
      meta: { requiresAuth: true },
    },
    {
      path: "/login",
      name: "login",
      component: Login,
      meta: { requiresAuth: false },
    },
    {
      path: "/albums",
      name: "albums",
<<<<<<< HEAD
      component: AlbumView,
      meta: { requiresAuth: true },
    },
    {
      path: "/albums/:id",
      name: "album-detail",
      component: AlbumDetailView,
=======
      component: () => import("../views/AlbumView.vue"),
      meta: { requiresAuth: true },
>>>>>>> 808097149b9b03668259b819c5529eb708b7a331
    },
  ],
});


export default router;